﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TuyenDungDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {


            int lang = 2;
            if (Request.QueryString["lang"] != "" && Request.QueryString["lang"] != null) lang = Convert.ToInt32(Request.QueryString["lang"]);

            TuyenDungDataSet gtDs = new TuyenDungHelper().LoadTuyenDung(Convert.ToInt32(Request["id"]));
            rptDetail.DataSource = gtDs;
            rptDetail.DataBind();
            int loai = Convert.ToInt32(gtDs.TuyenDung[0].Loai);
            if (gtDs.TuyenDung.Rows.Count > 0)
            {
                TuyenDungDataSet gtDst = new TuyenDungHelper().LoadTuyenDung(1,10,"NgayDang","desc",Convert.ToInt32(gtDs.TuyenDung[0].Loai), Convert.ToInt32(gtDs.TuyenDung[0].Lang));
                rptTinCungTheLoai.DataSource = gtDst;
                rptTinCungTheLoai.DataBind();
            }
            string strTen = "";
            if (lang == 1)
            {
                strTen = "Tuyển dụng >> ";
            }
            else
            {
                strTen = "Recruitment >> ";
            }
            lbpageName.Text = strTen + LoaiDataHelper.LoadLoaiTuyenDung()[loai].ToString() + " >> " + gtDs.TuyenDung[0].Ten;
        }
    }
}